package com.wnnight.wys.entity.room;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

/**
 * @ClassName: Room
 * @Description: //TODO
 * @author: CD
 * @date: 2022/8/27-16:52
 * @version: v1.0
 */
@Getter
@Setter
@ToString
@TableName(value = "room", keepGlobalPrefix = true)
public class Room {
    //采用IdentifierGenerator默认的实现类DefaultIdentifierGenerator生成id

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.ASSIGN_ID)
    long id;//id

    @NotNull(message = "楼号不能为空")
    @TableField("building_num")
    String buildingNum;//楼号

    @NotNull(message = "单元不能为空")
    @TableField("unit")
    String unit;//单元

    @NotNull(message = "楼层不能为空")
    @TableField("floor")
    int floor;//楼层

    @NotNull(message = "房间号不能为空")
    @TableField("room_num")
    String roomNum;//房间号

    @NotNull(message = "人数不能为空")
    @TableField("people_num")
    int peopleNum;//人数

    @NotNull(message = "状态不能为空")
    @TableField("status")
    String status;//空闲，正常，出租

    @TableField("landlord_id")
    Integer landlordId;//房东id

    @TableField("building_id")
    Integer buildingId;//楼id
    @TableField("unit_id")
    Integer unitId;//单元id
    @TableField("floor_id")
    Integer floorId;//楼层id


}
